package utils

import (
	"github.com/nats-io/stan.go"
	"longmen/server/config/global"
)

func ackHandler() stan.AckHandler {
	return func(ackedNuid string, err error) {
		if err != nil {
			global.Log.Warnf("Warning: error publishing msg id %s: %v\n", ackedNuid, err.Error())
		} else {
			global.Log.Infof("Received ack for msg id %s\n", ackedNuid)
		}
	}
}
